<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@page import="java.util.Date"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<%
   //设置无缓存
   response.setHeader("progma","no-cache");   
   response.setHeader("Cache-Control","no-cache");   
%> 

<c:set var="ctx" value="<%=request.getContextPath() %>"/>
<link rel="icon" href="${ctx }/images/favicon.ico"/>
<link rel="shortcut icon" href="${ctx }/images/favicon.ico"/>
<%@ page contentType="text/html;charset=UTF-8" %>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>科技</title>
<script src="${ctx }/js/jquery-1.10.2.js" type="text/javascript"></script>
<script src="${ctx }/js/easyui/jquery.easyui.min.js" type="text/javascript"></script>
<script src="${ctx }/js/easyui/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="${ctx }/js/base64.js" type="text/javascript"></script>
<link href="${ctx }/css/login/public.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/css/login/zhuce.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/css/jquery-easyui-1.3.4/easyui.css" rel="stylesheet" type="text/css" />
<link href="${ctx }/css/jquery-easyui-1.3.4/icon.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	

	function gotoRegister(){
		 $('#dd').dialog('open');
	}
	function register(type){
		$("#dd").dialog('close');
		document.location.href='${ctx}/login/gotoRegister?clientType=web&registerType='+type;
	}
	function gotoMainPage(id){
		$.ajax({
			  type: 'POST',
			  url: "${ctx }/system/weblogin",
			  data: {companyId:id},
			  dataType:"json",
			  timeout: 10000,
			  error: function(){
			  	alert('请求失败，请稍候再试');
			  },
			  success: function(result){
				  if(result.success){
					top.document.location.href="${ctx}/user/index";
				  }else{
			  		alert(result.msg);
				  }
			  }
			});
	}
	function doSubmit(){
		var username = $("#username").val();
		var password = $("#password").val();
		
		if(username.length = 0 ){
			alert('请输入用户名');
			$("#username").focus();
			return false;
		}
		if(password.length < 1){
			alert('请输入密码');
			$("#password").focus();
			return false;
		}

		$("#doSubmit").unbind('click');
		$.ajax({
		  type: 'POST',
		  url: "${ctx }/system/weblogin",
		  data: {username:username,password:password},
		  dataType:"json",
		  timeout: 10000,
		  error: function(){
		  	alert('请求失败，请稍候再试');
			$("#doSubmit").click(function(){
				doSubmit();
			});
		  },
		  success: function(result){
			  if(result.success){
			  		//查看是否需要保存账号密码。用base64加密
			  	top.document.location.href="${ctx}/user/index";
			  }else{
			  		alert(result.msg);
			  		$("#doSubmit").click(function(){
						doSubmit();
					});
			  }
		  }
		});
	}
	$(document).keydown(function(event){
         if(event.keyCode == '13'){
         	if($("#username").is(":focus") || $("#password").is(":focus")){
         		doSubmit();
         	}
         } 
         
         
    });
    
    function getCookie(c_name){
	     if (document.cookie.length>0){
		  c_start=document.cookie.indexOf(c_name + "=");
		  if (c_start!=-1){ 
		    c_start=c_start + c_name.length+1;
		    c_end=document.cookie.indexOf(";",c_start);
		    if (c_end==-1) {
		    	c_end=document.cookie.length;
		    }
		    return document.cookie.substring(c_start,c_end);
		   } 
		  }
		return "";
	}
    
    
	$(function(){
		$("#username").val();//用base64解密
		$("#password").val();
		$("#username").focus();
		$("#doSubmit").click(function(){
			doSubmit();
		});

	});
	function forgetPwd(){
		window.open("${ctx}/manage/login/forgetPwd?clientType=web");
	}
</script>
</head>
<body>

<table height="100%" width="100%" cellpadding="0" cellspacing="0">
	<tr>
    	<td valign="top">
<div class="wrap">
<div class="head">
<!-- 		<a href="http://www.elve.cn" target="_blank" ><img src="${ctx}/login/getLogo?clientType=web&id=<%=new Date() %>" onerror="this.src='${ctx }/images/logo/logo.gif'"  width="129" height="41" alt="logo" /></a> -->
		<a href="http://xxx" target="_blank" ><img src=""  width="129" height="41" alt="logo" /></a>
</div>

	<div class="content">
	<div class="contant_left">
    	<h3 class="title">后台系统</h3>
    	
        <dl class="leftpro">
        	<dt><img src="${ctx}/images/login/tb1.png" /></dt>
            <dd>
            	<h3>图书发布及管理</h3>
                <p>全天不限时间、不限次数的发布或修改图书的信息，可以通过此系统的课程查询已发布的图书信息</p>
            </dd>
        </dl>
    </div>
    <div class="content-right">
   
   	  <table width="272" height="292" border="0">
  <tr>
    <td width="97" align="left" style="color:#595959; font-weight:bold">登录名</td>
    <td colspan="2" align="right" style="color:#818181"></td>
    </tr>
  <tr>
    <td colspan="3" align="left"><label for="textfield"></label>
      <input type="text" name="username" id="username" style="width:249px; height:23px"  title="会员名称"  /></td>
    </tr>
  <tr>
    <td align="left" style="color:#595959; font-weight:bold">登录密码</td>
    <td width="92">&nbsp;</td>
    <td width="69">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="2" align="left"><label for="textfield2"></label>
      <input type="password" name="password" id="password" style="width:179px;height:23px" /></td>
  </tr>



  <tr>
    <td height="36" colspan="3" align="center">
    <a href="javascript:void(0)" class="login_btn1" id="doSubmit" onmouseup="this.className='login_btn1'" onmousedown="this.className='login_btn1_over'">登 录</a>
    </td>
    </tr>
</table>

  </div>
</div>


</div>
</td>
</tr>
</table>
</body>

</html>
